﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZF.BLL.Page;
using GCELibrary.Current;

namespace ZF.WS.Person
{
    public partial class getpwd :PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void Ok(object sender, EventArgs e)
        {
            if (!SiteInfo.ValidateCode(this.tbVCode.Text))
            {
                WarnFactory.CreateWarn(new PageWarnParameter()
                {
                    JscriptMode = true,
                    Link = WarnLink.GoBack,
                    Message = "验证码错误",
                }).Alert();
                return;
            }
            var success = SiteInfo.GetPwd(this.tbAccount.Text, this.tbEmail.Text);
            WarnFactory.CreateWarn(new PageWarnParameter()
                {
                    JscriptMode = true,
                    Link = WarnLink.GoBack,
                    Message = success?"密码已发送到您的邮箱，请注意查收":"您输入的帐号或者邮箱错误",
                }).Alert();
            return;
        }
    }
}
